In the field of data communications, a general definition of a "protocol" is a set of rules governing the exchange of messages between two or more communication devices. Ultimately, communications are between "end systems" in the sense that each end system is either a source or destination, or both, of information. Typically, the end systems are processor-based devices, such as computer workstations.
The use of standardized protocols permits different end systems to communicate even if they are from different manufacturers, or for some other reason have different designs. Communications tasks conforming to the protocols are performed by various processors, controllers, and other "intelligent" devices in the network.
The seven-layer Open System Interconnection (OSI) is a protocol model, developed by the International Standards Organization. Although there are protocol models other than the OSI model, and not all data communications tasks involve all layers of the OSI model, it can theoretically be used to define all aspects of data communications.
Each layer of a protocol, such as the OSI protocol, is a set of tasks to be performed by some sort of intelligent entity, whether in the form of hardware, firmware, or software. In the OSI model, the top three layers (application layer, presentation layer, and session layer) are specific to the users of the information services of the network. The middle layer (transport layer), maintains a communication channel and is a liaison between network service users and the network service providers. The lower three layers (network layer, data link layer, and physical layer) deal with the actual network providing the network services.
In this layered approach to communication protocols, communications may be "horizontal" or "vertical". Horizontal communications are those to "peer" entities of other end-systems. Vertical communications are those between adjacent layers of the same end system.
From a functional viewpoint, an end-system of a communications network can be thought of as a "stack" of protocol layers, residing in and managed by the end system's intelligent devices. On the sending end, user data are generated at the higher layers. Each layer receives a protocol data unit (PDU) from the layer above, which contains the user data and any header data added by prior layers. The layer adds its own control information as a header. At the bottom of the source node's stack, the physical layer transmits the PDU over a data link. The PDU then moves up the stack of the destination node, where at each layer, a peer layer strips off its header to invoke one or more protocol functions.
Implementation of the protocol stack requires some sort of stack management scheme for passing PDU's from layer to layer. Typically, an area of memory, generally referred to as a "buffer" is used to contain all or part of each PDU. An example of an existing stack management method for passing data is based on a first-in first-out queue. Data are contained in a buffer that contains the queue. Each layer uses its own buffer and data is copied from one buffer to another. However, every copying step requires additional processing overhead. The copying of data from one buffer to another is particularly burdensome when a protocol function requires a layer to send multiple copies of a PDU.
In addition to the problem of the overhead required for buffer copying, another problem with existing stack management schemes is the need to implement PDU segmentation. Typically, segmentation requires data to be copied from one size buffer to another, or to be handled as linked lists, which then requires special hardware support.
A need exists for a method of managing a protocol stack that minimizes processing overhead without requiring special hardware. Thus, an object of the invention is a protocol stack management system that avoids the need for physical copying of buffers. Before entering the protocol stack, message data is converted to a special buffer format. An envelope portion of the buffer contains at least a portion of the message, and is sufficiently small that it may contain a PDU to be sent out from the lowest layer of the protocol stack even after all layers have added their headers. A buffer header portion of the buffer contains data for managing sequencing and copying of the buffers. The buffers are passed from layer to layer by means of exclusive access to them, whereby the same memory is accessed by only one layer at a time.
In this manner, message data is "pre-segmented" into buffers. The buffers are passed from layer to layer, as a linked list representing a PDU, without copying. Any layer may segment the PDU by unlinking the buffers and adding its layer header to each buffer envelope, thereby creating multiple PDU's, one in each buffer. A peer layer of the segmenting layer uses data in the buffer to reassemble the PDU. If a layer of the source stack needs to re-send a buffer or otherwise use multiple copies, that layer may "checkpoint" the buffer so that the layer will regain the same buffer. At the destination stack, the PDU's may be reassembled by linking buffers, and the original message may be reconstructed.
An advantage of the stack management system of the invention is that it is faster than systems that require physical copies from layer to layer within an end system. It solves the problem of handling blocks of message data that are larger than the PDU that can be handled by any one layer, without extra processing overhead or special hardware.